<template>
  <div>
    <!-- v-bind 动态绑定属性 可以简写为 ： -->
    <!-- <img v-bind:src='src1' alt="">
    <a v-bind:href="tit">条百度</a>
    <input type="text" v-model="color">
    <input type="number" v-model="size"> -->
    <!-- <div :style="obj">123123123123232323</div> -->
    <!-- <div :style="{'background':color,fontSize:size+'px',}">123123123123232323</div> -->
    <!-- 上面为动态绑定style样式 -->

    <!-- <input type="checkbox" v-model="flag"> -->
    <!-- <div :style="{background:(flag?'red':'blue')}"> 666666</div> -->

    <!-- <input type="checkbox" v-model="flag">
    <div :class="(flag?'one':'two')">666666</div>
    <div :class="{one:flag}" class="two">777777</div>
    <div :class="[flag?'one':'two']" class="two">777777</div> -->
    <!-- class时判断要改为[] 这里写简单判断语句 这样就可以实现动态切换class -->
    <!-- <div :class="{flag?'one':'two'}" class="two">777777</div> -->
    <!-- <input type="text" v-model="keys">
    <div :[keys]="color">6666</div> -->
    <!-- 这里的属性名 也可以是变量 -->


    <!-- 实现一个tab切换 三个选项 -->

    <div class="headerItem"> <span @click="fun1(1)">one</span> <span @click="fun1(2)">two</span> <span @click="fun1(3)">three</span> </div>
    <ul class="content">
        <li v-for="item,index in arr1" :key="index" class="one">
            <div v-if="flag == 1">{{item}}</div>
        </li>
        <li v-for="item,index in arr2" :key="index" class="two">
            <div v-if="flag === 2">{{item}}</div>
        </li>
        <li v-for="item,index in arr3" :key="index" class="three">
            <div v-if="flag === 3">{{item}}</div>
        </li>
    </ul>


  </div>
</template>

<script>
export default {
    data(){
        return{
            // keys:"class",
            // flag:false,
            // size:'16',
            // color:'red',
            // obj:{
            //     background:'red'
            // },
            // title:"这是一个title",
            // tit:'https://www.baidu.com',
            // src1:"https://img95.699pic.com/photo/50464/9776.jpg_wh860.jpg"

            arr1:[1,2,3,4,5,6],
            arr2:[11,22,33,44,55,66],
            arr3:[111,222,333,444,555,666],
            flag:1,


        }
    },
    methods:{
        fun1(i){
            this.flag = i
        }
    }

}
</script>

<style>
*{
    margin: 0;
    padding: 0;
}

.headerItem{
    width: 300px;
    height: 30px;
    background-color: white;
    margin: 0 auto;
}
.content li{
    list-style: none;
    background-color: red;
    margin: 1px;
}
.content{
    width: 300px;
    height: 300px;
    border: 1px solid black;
    box-shadow: 0 0 20px 0px rgb(10, 83, 241);
    margin: 0 auto;
}
</style>